{extend name="main"}
{block name="content"}
<style>
    [data-upload-image] + .uploadimage {
        width: 38px;
        height: 38px;
        margin: 0 !important;
    }
</style>
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" id="GoodsForm">
    <div class="layui-card-body">
        <div class="think-box-shadow layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label label-required-next"><b>商品分类</b><span class="nowrap color-desc">Goods Cat</span></label>
                <div class="layui-input-inline">
                    <input disabled class="layui-input think-bg-gray" value="{$cats_path}">
                    <p class="help-block">选择正确分类有助识别您的商品。</p>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <a class="layui-btn layui-btn-xs layui-btn-danger" data-open='{:url("select")}?cat_id={$vo.cat_id|default="0"}&goods_id={$vo.id|default="0"}'>修改分类</a>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><b>商品名称</b><span class="nowrap color-desc">Goods Name</span></label>
                <div class="layui-input-block">
                    <input name="goods_name" lay-verify="required" required placeholder="请输入商品名称" value="{$vo.goods_name|default=''}" class="layui-input">
                    <p class="help-block">商品标题与实际售卖商品信息一致、真实。请勿出现违禁词，请勿发布违禁商品，标题中请勿使用制表符、换行符。若填入制表符、换行符，系统将自动替换成空格。</p>
                </div>
            </div>
            <div class="layui-form-item" style="margin-bottom:unset;">
                <label class="layui-form-label label-required-next"><b>商品属性</b><span class="nowrap color-desc">Goods Attr</span></label>
                <div class="layui-input-block layui-bg-gray padding-bottom-10">
                    <div class="layui-inline margin-top-15">
                        <label class="layui-form-label">商品货号</label>
                        <div class="layui-input-inline">
                            <input name="goods_name" lay-verify="required" required placeholder="请输入货号" value="{$vo.goods_sn|default=''}" class="layui-input">
                        </div>
                    </div>
                    <!-- {foreach $attrs as $attr} -->
                        <!-- {neq name='attr.attr_type' value='2'} -->
                            <!-- {eq name='attr.attr_input_type' value='0'} -->
                            <div class="layui-inline margin-top-15">
                                <label class="layui-form-label {eq name='attr.is_choose' value='0'}label-required-next{/eq}">{$attr.attr_name}</label>
                                <div class="layui-input-inline">
                                    <input name="goods_name" lay-verify="required" required placeholder="请输入{$attr.attr_name}" value="" class="layui-input">
                                </div>
                            </div>
                            <!-- {/eq} -->
                            <!-- {eq name='attr.attr_input_type' value='1'} -->
                                <!-- {eq name='attr.attr_type' value='0'} -->
                                <div class="layui-inline margin-top-15">
                                    <label class="layui-form-label {eq name='attr.is_choose' value='0'}label-required-next{/eq}">{$attr.attr_name}</label>
                                    <div class="layui-input-inline">
                                        <div id="attr{$attr.id}" class="xm-select-demo"></div>
                                    </div>
                                </div>
                                <script>
                                    layui.use(['xmSelect'],function() {
                                        var attr = xmSelect.render({
                                            el: '#attr'+ "{$attr.id}",
                                            filterable: true,
                                            radio: true,
                                            clickClose: true,
                                            theme: {
                                                color: '#aaaaaa',
                                            },
                                            model: {
                                                label: {
                                                    type: 'text',
                                                    text: {
                                                        //左边拼接的字符
                                                        left: '',
                                                        //右边拼接的字符
                                                        right: '',
                                                        //中间的分隔符
                                                        separator: ', ',
                                                    },
                                                }
                                            },
                                            data: JSON.parse('{$attr.attr_value|raw}'),
                                        })
                                    });
                                </script>
                                <!-- {/eq} -->
                                <!-- {eq name='attr.attr_type' value='1'} -->
                                <!-- 多选待完善 -->
                                <div class="layui-inline margin-top-15">
                                    <label class="layui-form-label {eq name='attr.is_choose' value='0'}label-required-next{/eq}">{$attr.attr_name}</label>
                                    <div class="layui-input-inline">
                                        <div id="attr{$attr.id}" class="xm-select-demo"></div>
                                    </div>
                                </div>
                                <script>
                                    layui.use(['xmSelect'],function() {
                                        var attr = xmSelect.render({
                                            el: '#attr'+ "{$attr.id}",
                                            max: '{$attr.attr_smax}',
                                            filterable: true,
                                            theme: {
                                                color: '#aaaaaa',
                                            },
                                            model: {
                                                label: {
                                                    type: 'text',
                                                    text: {
                                                        //左边拼接的字符
                                                        left: '',
                                                        //右边拼接的字符
                                                        right: '',
                                                        //中间的分隔符
                                                        separator: ', ',
                                                    },
                                                }
                                            },
                                            data: JSON.parse('{$attr.attr_value|raw}'),
                                        })
                                    });
                                </script>
                                <!-- {/eq} -->
                            <!-- {/eq} -->
                        <!-- {/neq} -->
                    <!-- {/foreach} -->
                </div>
            </div>
        </div>
        <div class="think-box-shadow margin-top-15">
            <div class="layui-form-item" style="margin-bottom:unset;">
                <label class="layui-form-label label-required-next"><b>商品规格</b><span class="nowrap color-desc">Goods Spec</span></label>
                <div class="layui-input-block layui-bg-gray">
                    <!-- {foreach $attrs as $attr} -->
                        <!-- {eq name='attr.attr_type' value='2'} -->
                            <!-- {eq name='attr.attr_input_type' value='1'} -->
                            <p class="help-block layui-bg-gray padding-bottom-10"><input disabled class="layui-input think-bg-gray" value="{$attr.attr_name}"></p>
                            <div class="layui-input-block" style="margin-left:unset;padding-left: 30px;">
                                <div class="layui-inline layui-form-pane padding-bottom-5">
                                    <div class="layui-input-inline" style="width: unset;">
                                        <input data-upload-image name="img[]" type="hidden" style="width: 40px;">
                                        <script>$('input[data-upload-image]').uploadOneImage();</script>
                                    </div>
                                    <div class="layui-input-inline" style="width: unset;margin-right:unset">
                                        <input type="text" class="layui-input" style="width: 120px;">
                                    </div>
                                    <div class="layui-input-inline" style="width: unset;">
                                        <input type="text" class="layui-input" style="width: 120px;">
                                    </div>
                                </div>
                                <div class="layui-inline layui-form-pane padding-bottom-5">
                                    <div class="layui-input-inline" style="width: unset;margin-right:unset">
                                        <button type="button" class="layui-btn layui-btn-disabled">
                                            <i class="layui-icon">&#xe654;</i>新增规格项</button>
                                    </div>
                                </div>
                            </div>
                            <!-- {/eq} -->
                            <!-- {eq name='attr.attr_input_type' value='2'} -->
                            <p class="help-block layui-bg-gray padding-bottom-10"><input disabled class="layui-input think-bg-gray" value="{$attr.attr_name}"></p>
                            <div class="layui-input-block" style="margin-left:unset;padding-left: 30px;">
                                <div class="layui-inline layui-form-pane padding-bottom-5">
                                    <div class="layui-input-inline" style="width: unset;">
                                        <input data-upload-image name="img[]" type="hidden" style="width: 40px;">
                                        <script>$('input[data-upload-image]').uploadOneImage();</script>
                                    </div>
                                    <div class="layui-input-inline" style="width: unset;margin-right:unset">
                                        <input type="text" class="layui-input" style="width: 120px;">
                                    </div>
                                    <div class="layui-input-inline" style="width: unset;">
                                        <input type="text" class="layui-input" style="width: 120px;">
                                    </div>
                                </div>
                                <div class="layui-inline layui-form-pane padding-bottom-5">
                                    <div class="layui-input-inline" style="width: unset;margin-right:unset">
                                        <button type="button" class="layui-btn layui-btn-disabled">
                                            <i class="layui-icon">&#xe654;</i>新增规格项</button>
                                    </div>
                                </div>
                            </div>
                            <!-- {/eq} -->
                        <!-- {/eq} -->
                    <!-- {/foreach} -->
                </div>
            </div>
        </div>
        <div class="think-box-shadow margin-top-15">
            <div class="layui-form-item">
                <label class="layui-form-label label-required-next"><b>商品详情</b><span class="nowrap color-desc">Goods Desc</span></label>
            </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="layui-footer layui-form-item text-center">
            <button class="layui-btn" type="submit" lay-submit>保存配置</button>
        </div>
    </div>
</form>
{/block}